package com.ruoyi.system.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.RemoteKingdeeService;
import com.ruoyi.system.api.domain.EmpResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author zhengcl
 * @since 1.0.0
 */
@Component
public class KingdeeFallbackFactory implements FallbackFactory<RemoteKingdeeService>
{
    private static final Logger log = LoggerFactory.getLogger(KingdeeFallbackFactory.class);

    @Override
    public RemoteKingdeeService create(Throwable throwable)  {
        log.error("文件服务调用失败:{}", throwable.getMessage());
        return new RemoteKingdeeService() {
            @Override
            public void saveMaterialIncase(@RequestParam("approveDate") String approveDate)
            {

            }

            @Override
            public void saveMaterialTransferin(@RequestParam("approveDate") String approveDate)
            {
//                return R.fail("文件入库失败:" + throwable.getMessage());
            }

            @Override
            public void saveMaterialTransferout(@RequestParam("approveDate") String approveDate)
            {

            }

            @Override
            public R<List<EmpResponse>> getEmpByIdCard(String idcard) {
                return null;
            }

            @Override
            public void saveStapByStapcode(String stapCode) {

            }
        };
    }


}
